<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0"
	prefix="dsp"%>
<dsp:page>
	<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@include file="style.jspf"%>
<title>Shopping Cart</title>
<dsp:importbean bean="/atg/commerce/order/ShoppingCartModifier" />
<dsp:importbean bean="/atg/dynamo/droplet/ErrorMessageForEach" />
<dsp:getvalueof var="order"
	bean="ShoppingCartModifier.shoppingCart.current" />
<dsp:importbean bean="/atg/dynamo/droplet/ForEach" />

<dsp:importbean bean="/atg/commerce/order/purchase/RepriceOrderDroplet" />
<dsp:droplet name="RepriceOrderDroplet">
	<dsp:param value="ORDER_SUBTOTAL" name="pricingOp" />
</dsp:droplet>
<script src="scripts/atgBootCamp.js" type="text/javascript"></script>
	</head>
	<body>
		<div id="wrap" class="clear-block">
			<div id="header">
				<dsp:include page="header.jsp" />
			</div>
			<h3>shopping cart</h3>
			<dsp:droplet name="ErrorMessageForEach">
				<dsp:param bean="ShoppingCartModifier.formExceptions"
					name="exceptions" />
				<dsp:oparam name="output">
					<div class="errorBox">
						<dsp:valueof param="message" />
					</div>
				</dsp:oparam>
			</dsp:droplet>
			<div class="shoppingCart">
				<dsp:form action="shoppingCart.jsp" method="post">
					<dsp:input bean="ShoppingCartModifier.removalCatalogRefIds"
						type="hidden" />
					<dsp:droplet name="ForEach">
						<dsp:param name="array"
							bean="ShoppingCartModifier.shoppingCart.current.commerceItems" />
						<dsp:param name="elementName" value="commerceItem" />
						<dsp:oparam name="outputStart">
							<div class="listBox">
								<ul class="head">
									<li class="item">Item</li>
									<li class="qty">Quantity</li>
									<li class="price">Price</li>
									<li class="actions">&nbsp;</li>
								</ul>
							</div>
						</dsp:oparam>
						<dsp:oparam name="output">
							<div class="listBox">
								<ul>
									<li class="item">
										<p class="name">
											<dsp:a href="productDetail.jsp">
												<dsp:param name="pId"
													param="commerceItem.auxiliaryData.productId" />
												<dsp:valueof
													param="commerceItem.auxiliaryData.productRef.displayName"></dsp:valueof>
											</dsp:a>
										</p>
										<p>
											SKU: <span> <dsp:valueof
													param="commerceItem.catalogRefId" />
											</span>
										</p>
									</li>
									<li class="qty"><input
										name='<dsp:valueof param="commerceItem.catalogRefId"/>'
										value='<dsp:valueof param="commerceItem.quantity"/>'
										type="text" class="textInput" /></li>
									<li class="price"><dsp:valueof
											param="commerceItem.priceinfo.amount" converter="currency" />
									</li>
									<li class="actions"><dsp:getvalueof var="catalogRefId"
											param="commerceItem.catalogRefId" /> <input type="button"
										value="Remove" class="btn"
										onclick="javascript:removeItem('${catalogRefId}');" /></li>
								</ul>
							</div>
						</dsp:oparam>
					</dsp:droplet>

					<div class="noteBox">
						<dsp:input type="submit" bean="ShoppingCartModifier.setOrder"
							value="Update Cart" iclass="btn small" />
						Note: Please click " update cart" after changed quantity,
						otherwise the change will be ignored.
					</div>
					<div class="totalBox">
						<table>
							<tr>
								<td width="92%" class="subTotal">Sub Total</td>
								<td width="8%" class="subTotal"><dsp:valueof
										bean="ShoppingCartModifier.shoppingCart.current.priceInfo.amount"
										converter="currency" /></td>
							</tr>
						</table>
					</div>

					<div class="btnBox">
						<a href="chkReview.jsp" class="btn"><span>express
								checkout</span></a> <a href="chkPaymentInfo.jsp" class="btn"><span>checkout</span></a>
						<a href="checkout.jsp" class="btn"><span>WeekOne
								checkout</span></a>
					</div>
				</dsp:form>
			</div>

			<div id="footer">
				<dsp:include page="footer.jsp" />
			</div>
		</div>
	</body>
</dsp:page>
</html>